home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / tan_snd.arc / R.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-27  |  2KB  |  79 lines

  1. { R.PAS - Demo of music and drum routines for Tandy 1000 and/or PCJr }
  2.  
  3. uses drums,noiz;
  4.  
  5. var
  6.   cnt,i,j,k: integer;
  7.   parm1: string;
  8.  
  9. function value(st: string): integer;
  10. var n,n1: integer;
  11. begin
  12.   val(st,n,n1);
  13.   if (n1 <> 0) then
  14.   begin
  15.     st:=copy(st,1,n1-1);
  16.     val(st,n,n1)
  17.   end;
  18.   value:=n;
  19.   if (st = '') then value:=0;
  20. end;
  21.  
  22. procedure melody(v: voices;s: styles);
  23. begin
  24.   sound(e2);
  25.   play(e4,20,v,s); play(b4,20,v,s);
  26.   play(a4,20,v,s); play(d4,20,v,s);
  27. end;
  28.  
  29. procedure scale1;
  30. begin
  31.   sound(e2);
  32.   play(e4,23,0,2); play(fs4,23,0,2);
  33.   play(g4,23,1,2); play(a5, 23,1,2);
  34.   play(b5,23,0,2); play(cs5,23,0,2);
  35.   play(d5,23,1,2); play(e5, 23,1,2);
  36. end;
  37.  
  38. begin
  39.   quiet;
  40.   cnt:=0;
  41.   parm1:=paramstr(1);
  42.   writeln('Strike Any Key to End');
  43.   writeln('Note: if you enter a number <1..9 etc.> as a parameter');
  44.   writeln('      the song will repeat that many times unless hey hit');
  45.   crash(1,55);
  46.   repeat
  47.     inc(cnt);
  48.     scale1; quiet;
  49.     melody(1,1);
  50.     quiet;
  51.     sound(e2);  chord(e5,b5,fs5,12,15);
  52.     sound(fs2); chord(fs5,cs5,fs5,12,15);
  53.     sound(b2);  chord(b5,fs5,g5,12,15);
  54.     sound(d2);  chord(d5,g5,fs5,12,15);
  55.     sound(a2);  chord(a5,e5,g5,12,15);
  56.     sound(e2);  chord(e6,b6,fs6,12,15);
  57.     melody(1,4);
  58.     sound(a2);  chord(a5,e5,a4,12,12);
  59.     sound(c1);  chord(a5,fs5,c4,12,16);
  60.     sound(d1);  chord(a5,g5,d4,12,12);
  61.     sound(e1);  chord(a5,a5,e4,12,16);
  62.     sound(g1);  chord(a5,b5,g4,12,12);
  63.     sound(a3);  chord(a6,c6,a5,12,16);
  64.     melody(1,3);
  65.     sound(e2);  chord(e3,b4,fs4,55,15);
  66.     sound(d2);  play(d4,20,1,4);
  67.     sound(g2);  play(g4,20,1,4);
  68.     sound(cs2); play(cs4,20,1,4);
  69.     sound(fs2); play(fs4,20,1,4);
  70.     sound(e2);
  71.     scale(e3,cs4,fs4,fs2,e2,g2,a2,as2,b2,cs2,d2);
  72.     quiet;
  73.     sound(e2); chord(e3,b4,g4,55,16);
  74.     crash(1,22); crash(1,37);
  75.     quiet;
  76.   until (cnt = value(parm1)) or keyhit;
  77.   quiet;
  78. end.
  79.